﻿--HEADER IX_Action_FundBookEntityId

IF EXISTS (SELECT * 
                FROM sys.indexes  
                WHERE name='IX_FundBookEntityId' AND object_id = OBJECT_ID('[UDS].[Action]'))
BEGIN
    DROP INDEX [IX_FundBookEntityId] ON [UDS].[Action]
END

GO

IF NOT EXISTS (SELECT * 
                FROM sys.indexes  
                WHERE name='IX_Action_FundBookEntityId' AND object_id = OBJECT_ID('[UDS].[Action]'))
BEGIN
    CREATE NONCLUSTERED INDEX [IX_Action_FundBookEntityId] ON [UDS].[Action]
	(
		[FundBookEntityId] ASC
	)
	INCLUDE 
	(
	 	[Id],
		[IdeaId],
		[CreatorCode],
		[ActionDateTime],
		[Type],
		[ActionData]
	)
END